//
//  KATShapeUtil.h
//  KATFramework
//
//  Created by Kantice on 16/3/20.
//  Copyright © 2016年 KatApp. All rights reserved.
//  形状工具，用于获取常用的形状（KATShape）

#import <UIKit/UIKit.h>
#import "KATShape.h"
#import "KATColor.h"
#import "KATFloatArray.h"
#import "KATMath.h"


//线型
#define SHAPE_LINE_H 111
#define SHAPE_LINE_V 112
#define SHAPE_LOADING 121
#define SHAPE_CHECK 122
#define SHAPE_CROSS 123
#define SHAPE_PLUS 124
#define SHAPE_JUMP 131
#define SHAPE_ARROW_U 141
#define SHAPE_ARROW_D 142
#define SHAPE_ARROW_L 143
#define SHAPE_ARROW_R 144
#define SHAPE_DAISY 151

//封闭型
#define SHAPE_RECT 411
#define SHAPE_RECT_R 412
#define SHAPE_DIAMOND 413
#define SHAPE_OVAL 420
#define SHAPE_TRIANGLE 430


//组合型
#define SHAPE_SUCCESS 711
#define SHAPE_FAIL 712
#define SHAPE_ADD 713




@interface KATShapeUtil : NSObject


#pragma -mark 类方法

///获取形状的通用方法
+ (KATShape *)shapeWithType:(int)type andWidth:(float)width andHeight:(float)height;

///检查是否有该类型
+ (BOOL)hasShapeType:(int)type;


#pragma -mark 线型

///获取直线
+ (KATShape *)lineShapeWithStartPoint:(CGPoint)startPoint andEndPoint:(CGPoint)endPoint;

///获取三点线型
+ (KATShape *)lineShapeWithPointA:(CGPoint)pa pointB:(CGPoint)pb pointC:(CGPoint)pc;

///获取四点线型
+ (KATShape *)lineShapeWithPointA:(CGPoint)pa pointB:(CGPoint)pb pointC:(CGPoint)pc pointD:(CGPoint)pd;

///获取五点线型
+ (KATShape *)lineShapeWithPointA:(CGPoint)pa pointB:(CGPoint)pb pointC:(CGPoint)pc pointD:(CGPoint)pd pointE:(CGPoint)pe;

///获取N点线型
+ (KATShape *)lineShapeWithPoints:(KATArray *)points andClosed:(BOOL)closed;

///获取N点平滑曲线(平滑度，0.382~0.618之间比较合适)
+ (KATShape *)curveShapeWithPoints:(KATArray *)points andSmooth:(float)smooth closed:(BOOL)closed;

///获取圆弧
+ (KATShape *)arcShapeWithRadius:(float)radius startAngle:(float)startAngle endAngle:(float)endAngle clockwise:(BOOL)clockwise;

///获取勾
+ (KATShape *)checkShapeWithWidth:(float)width andHeight:(float)height;

///获取叉
+ (KATShape *)crossShapeWithWidth:(float)width andHeight:(float)height;

///获取加号
+ (KATShape *)plusShapeWithWidth:(float)width andHeight:(float)height;

///获取跳跃抛物线轨迹
+ (KATShape *)jumpShapeWithStartPoint:(CGPoint)sp endPoint:(CGPoint)ep andHeight:(float)height;

///获取箭头(从上下箭头的角度看:高度为整体高度，宽度为箭头的宽度;左右箭头则相反，长度为箭头的余弦长)(方向:0左、1上、2右、3下)
+ (KATShape *)arrowShapeWithWidth:(float)width height:(float)height length:(float)length andDirection:(int)direction;

///获取菊花(宽度、内径、花瓣数)
+ (KATShape *)daisyShapeWithWidth:(float)width radius:(float)radius andAmounts:(int)amounts;



#pragma -mark 封闭形状

///获取矩形
+ (KATShape *)rectShapeWithWidth:(float)width andHeight:(float)height;

///获取圆角矩形
+ (KATShape *)roundedRectShapeWithWidth:(float)width andHeight:(float)height andCornerRadius:(float)radius;

///获取菱形
+ (KATShape *)diamondShapeWithWidth:(float)width andHeight:(float)height;

///获取圆形
+ (KATShape *)roundShapeWithRadius:(float)radius;

///获取切圆形
+ (KATShape *)cutRoundShapeWithRadius:(float)radius startAngle:(float)startAngle endAngle:(float)endAngle clockwise:(BOOL)clockwise;

///获取椭圆
+ (KATShape *)ovalShapeWithWidth:(float)width andHeight:(float)height;

///获取等腰三角形
+ (KATShape *)isoscelesTriangleShapeWithWidth:(float)width andHeight:(float)height;

///获取等边三角形
+ (KATShape *)equilateralTriangleShapeWithLength:(float)length;

///获取三角形
+ (KATShape *)triangleShapeWithPointA:(CGPoint)pa andPointB:(CGPoint)pb andPointC:(CGPoint)pc;

///获取扇形
+ (KATShape *)sectorShapeWithRadius:(float)radius width:(float)width startAngle:(float)startAngle endAngle:(float)endAngle clockwise:(BOOL)clockwise;

///获取气泡(尺寸、圆角半径、箭头点、箭头宽度、箭头高度)(方向:0左、1上、2右、3下)
+ (KATShape *)bubbleShapeWithSize:(CGSize)size cornerRadius:(float)radius andArrowPoint:(CGPoint)point width:(float)width height:(float)height direction:(int)direction;



#pragma -mark 组合形状

///获取成功形状(圆圈＋勾)
+ (KATShape *)successShapeWithWidth:(float)width;

///获取失败形状(圆圈＋叉)
+ (KATShape *)failShapeWithWidth:(float)width;

///获取添加形状(圆圈＋加号)
+ (KATShape *)addShapeWithWidth:(float)width;





//盾形

//心形

//五边形

//五角星

//五芒星

//六边形

//六角星

//六芒星

//八边形

//八角星

//梯形

//圆锥型

//漏斗型

//月型

//杯型

//半圆




@end



